package com.ruoyi.point.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.point.domain.ExchangeOrder;

import java.util.Date;

/**
 * 物流信息对象 logistics
 * 
 * @author hy
 * @date 2025-08-12
 */
public class Logistics extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 物流ID */
    private Integer id;

    /** 订单ID */
    @Excel(name = "订单ID")
    private Integer orderId;

    /** 快递公司 */
    @Excel(name = "快递公司")
    private String expressCompany;

    /** 快递单号 */
    @Excel(name = "快递单号")
    private String expressNo;

    /** 物流状态：0-已兑换，1-已发货，2-已签收 */
    @Excel(name = "物流状态：0-已兑换，1-已发货，2-已签收")
    private Long status;

    /** 是否删除：0正常 1删除 */
    @Excel(name = "是否删除：0正常 1删除")
    private Integer del;

    /** 签收时间 */
    @Excel(name = "签收时间")
    private Date receiptedTime;

    private ExchangeOrder exchangeOrder;

    // 物流状态常量
    public static final Long STATUS_EXCHANGED = 0L;    // 已兑换
    public static final Long STATUS_SHIPPED = 1L;      // 已发货
    public static final Long STATUS_RECEIVED = 2L;     // 已签收

    /**
     * 设置物流状态为已发货
     */
    public void setShippedStatus() {
        this.status = STATUS_SHIPPED;
    }

    /**
     * 设置物流状态为已签收
     */
    public void setReceivedStatus() {
        this.status = STATUS_RECEIVED;
        this.receiptedTime = new Date(); // 设置签收时间
    }

    public void setId(Integer id) 
    {
        this.id = id;
    }

    public Integer getId() 
    {
        return id;
    }

    public void setOrderId(Integer orderId) 
    {
        this.orderId = orderId;
    }

    public Integer getOrderId() 
    {
        return orderId;
    }

    public void setExpressCompany(String expressCompany) 
    {
        this.expressCompany = expressCompany;
    }

    public String getExpressCompany() 
    {
        return expressCompany;
    }

    public void setExpressNo(String expressNo) 
    {
        this.expressNo = expressNo;
    }

    public String getExpressNo() 
    {
        return expressNo;
    }

    public void setStatus(Long status) 
    {
        this.status = status;
    }

    public Long getStatus() 
    {
        return status;
    }

    public void setDel(Integer del) 
    {
        this.del = del;
    }

    public Integer getDel() 
    {
        return del;
    }

    public Date getReceiptedTime() 
    {
        return receiptedTime;
    }

    public void setReceiptedTime(Date receiptedTime) 
    {
        this.receiptedTime = receiptedTime;
    }

    public ExchangeOrder getExchangeOrder() 
    {
        return exchangeOrder;
    }

    public void setExchangeOrder(ExchangeOrder exchangeOrder) 
    {
        this.exchangeOrder = exchangeOrder;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("orderId", getOrderId())
            .append("expressCompany", getExpressCompany())
            .append("expressNo", getExpressNo())
            .append("status", getStatus())
            .append("createTime", getCreateTime())
            .append("receiptedTime", getReceiptedTime())
            .append("del", getDel())
            .append("exchangeOrder", getExchangeOrder())
            .toString();
    }
}
